From 83f4b72ab196d418b9b1edd0655a9a96acfa753b Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 13 Jul 2020 12:11:32 +0100 Subject: [PATCH] jail: actually chdir into OCI defined CWD Current working directory was parsed by never applied. Apply it just before executing user process. Signed-off-by: Daniel Golle --- jail/jail.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jail/jail.c b/jail/jail.c index 5018fcc..1650534 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -710,6 +710,9 @@ static int exec_jail(void *pipes_ptr) if (!envp) exit(EXIT_FAILURE); + if (opts.cwd && chdir(opts.cwd)) + exit(EXIT_FAILURE); + if (opts.ociseccomp && applyOCIlinuxseccomp(opts.ociseccomp)) exit(EXIT_FAILURE); -- 2.30.2